<?php require_once('Connections/MYCONN.php'); ?>
<?php


if(isset($_GET["Action"]) && $_GET["Action"] != "" && $_GET["Action"] == 99)
{
	if(isset($_GET["TblName"]) && $_GET["TblName"] != "")
	{
		$TblName = $_GET["TblName"];
	}
	
	if(isset($_GET["ID"]) && $_GET["ID"] != "")
	{
		$ID = base64_decode($_GET["ID"]);
	}
	
	if(isset($_GET["ParentID"]) && $_GET["ParentID"] != "")
	{
		$ParentID = base64_decode($_GET["ParentID"]);
	}
	
	$deleteSQL ="DELETE FROM tb_activity WHERE ParentID = ".$ID;
	mysql_select_db($database_MYCONN, $MYCONN);
	$Result1 = mysql_query($deleteSQL, $MYCONN) or die(mysql_error());
		
	$deleteSQL ="DELETE FROM ".$TblName."  WHERE ID = ".$ID;
	mysql_select_db($database_MYCONN, $MYCONN);
	$Result1 = mysql_query($deleteSQL, $MYCONN) or die(mysql_error());

	$deleteSQL ="DELETE FROM tb_register_master_netsales WHERE ID = ".$ID;
	mysql_select_db($database_MYCONN, $MYCONN);
	$Result1 = mysql_query($deleteSQL, $MYCONN) or die(mysql_error());

	header("Location:  ActivityLog3.php?ID=".base64_encode($ParentID));

}


if(isset($_GET["Action"]) && $_GET["Action"] != "" && $_GET["Action"] == -1)
{
	if(isset($_GET["TblName"]) && $_GET["TblName"] != "")
	{
		$TblName = $_GET["TblName"];
	}
	
	if(isset($_GET["ID"]) && $_GET["ID"] != "")
	{
		$ID = base64_decode($_GET["ID"]);
	}
	
	
	if(isset($_GET["ParentID"]) && $_GET["ParentID"] != "")
	{
		$ParentID = base64_decode($_GET["ParentID"]);
	}
	
	$deleteSQL ="DELETE FROM ".$TblName."  WHERE ID = ".$ID;
	
	//echo $deleteSQL ;
	
	mysql_select_db($database_MYCONN, $MYCONN);
	$Result1 = mysql_query($deleteSQL, $MYCONN) or die(mysql_error());
	
	//echo $Result1;
	header("Location:  ActivityLog3.php?ID=".base64_encode($ParentID));
	
}


?>